package cn.tx.order.feign.client;

import cn.tx.order.feign.fallback.OrderClientFallBack;
import cn.tx.pojo.domain.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 订单客户端feign接口
 * @author: zealon
 * @since: 2019/7/4
 */
@FeignClient(value = "order-server", fallbackFactory = OrderClientFallBack.class)
//@FeignClient(contextId = "order", name = "order-server", fallbackFactory = OrderClientFallBack.class)
public interface OrderClient {

    @GetMapping("/order/getOrderById/{id}")
    Order getOrderById(@PathVariable("id") Long id);

    @GetMapping("/order/getListOrder")
    List<Order> getListOrder(@RequestParam Map<String, Object> params);

}